apiVersion: apps/v1
kind: Deployment
metadata:
  name: ${deployName}
  namespace: ${namespace}
  labels:
    app: ${deployName}
    k8s.kuboard.cn/layer: web
  annotations:
    kubesphere.io/description: ${kubesphereDescription}
    k8s.kuboard.cn/displayName: ${kubesphereDescription}
spec:
  selector:
    matchLabels:
      app: ${deployName}
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: ${deployName}
        k8s.kuboard.cn/layer: web
    spec:
      # initContainers:
        # Init containers are exactly like regular containers, except:
          # - Init containers always run to completion.
          # - Each init container must complete successfully before the next one starts.
      containers:
      - name: ${deployName}
        image: {{ image }}
        resources:
          requests:
            cpu: 10m
            memory: 10Mi
          # limits:
          #   cpu: 100m
          #   memory: 100Mi
#        livenessProbe:
#          tcpSocket:
#            port: 80
#          initialDelaySeconds: 5
#          timeoutSeconds: 5
#          successThreshold: 1
#          failureThreshold: 10
#          periodSeconds: 30
        readinessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 5
          timeoutSeconds: 5
          successThreshold: 1
          failureThreshold: 3
          periodSeconds: 10
        env:
        - name: TZ
          value: Asia/Shanghai
        ports:
        - containerPort:  80
          name:  web
      restartPolicy: Always
      imagePullSecrets:
        - name: aliyun-reg